<template>
  <el-card class="box-card">
    <div style="margin: 20px"/>
    <el-form
        :label-position="'left'"
        label-width="66px"
        :model="user"
        style="max-width: 460px">
      <el-form-item label="账号：" required>
        <el-input v-model="user.account"/>
      </el-form-item>
      <el-form-item label="密码：" required>
        <el-input type="password" v-model="user.password"/>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">登录</el-button>
      </el-form-item>
    </el-form>
  </el-card>
</template>
<script setup>
import {reactive, ref} from 'vue'
import {useRouter} from "vue-router";

const user = reactive({
  account: '',
  password: '',
});
const router = useRouter();
const onSubmit = function () {
  router.push({
    path: '/index',
    query: user
  });
};
</script>
<script>
export default {
  name: "Login"
}
</script>

<style scoped>
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.box-card {
  width: 480px;
}
</style>